extends layout

block content
  - var time = format_unixtime(tx.timestamp)
  .col-xs-12.col-md-10.col-md-offset-1
    .well.well-sm.hidden-lg.hidden-md(style='word-wrap:break-word;')
      | #{tx.txid}
    .panel.panel-default
      .panel-heading.hidden-xs
        strong #{settings.symbol} txid: #{tx.txid}
        a(href='/api/getrawtransaction?txid=#{tx.txid}&decrypt=1')
          span.glyphicon.glyphicon-info-sign.iquidus.pull-right
      table.table.table-bordered.table-striped.summary-table 
        thead
          tr
            th #{settings.locale.confirmations}
            th.hidden-xs #{settings.locale.tx_block_hash}
            th #{settings.locale.timestamp}
            th
        tbody
          - var confirms = (blockcount - tx.blockindex);
          if confirms >= confirmations                
            tr.success
                td #{confirms}
                td.hidden-xs 
                  a(href='/block/#{tx.blockhash}') #{tx.blockhash}
                td #{time}
                td.view_tx  
                  a(href='/block/#{tx.blockhash}')
                    span.glyphicon.glyphicon-eye-open 
          else
            if confirms < (confirmations / 2)
              tr.danger
                td #{confirms}
                td.hidden-xs  
                  a(href='/block/#{tx.blockhash}') #{tx.blockhash}
                td #{time}
                td.view_tx  
                  a(href='/block/#{tx.blockhash}')
                    span.glyphicon.glyphicon-eye-open 
            else
              tr.warning
                td #{confirms}
                td.hidden-xs  
                  a(href='/block/#{tx.blockhash}') #{tx.blockhash}
                td #{time}
                td.view_tx  
                  a(href='/block/#{tx.blockhash}')
                    span.glyphicon.glyphicon-eye-open
    if tx.vout.length < 1
      .alert.alert-info(role='alert', style='text-align:center;')   
        strong #{settings.locale.tx_nonstandard}
    else
      .row
        .col-md-6
          .panel.panel-default
            .panel-heading
              strong #{settings.locale.tx_contributors}
              span.glyphicon.glyphicon-arrow-right.pull-right.hidden-xs
            table.table.table-bordered.table-striped.summary-table 
              thead
                tr
                  th #{settings.locale.tx_address}
                  if (tx.vin.length > 0)
                    if tx.vin[0].addresses != 'coinbase'
                      th.hidden-xs #{settings.locale.mkt_amount} (#{settings.symbol})
              tbody
                if tx.vin.length > 0
                  each r in tx.vin
                    if r.addresses == 'coinbase' 
                      tr.info(style='text-align:center')
                        td #{settings.locale.new_coins}
                    else
                      - var ramount = r.amount / 100000000
                      tr
                        td 
                          a.loading(href='/address/#{r.addresses}') 
                            =r.addresses
                        td.danger.hidden-xs #{ramount.toFixed(8)}
                      tr.hidden-lg.hidden-md
                          td.danger #{ramount.toFixed(8)} #{settings.symbol}
                else
                  tr.info(style='text-align:center')
                    td #{settings.locale.proof_of_stake}
        .col-md-6
          .panel.panel-default
            .panel-heading
              strong #{settings.locale.tx_recipients}
            table.table.table-bordered.table-striped.summary-table 
              thead
                tr
                  th #{settings.locale.tx_address}
                  th.hidden-xs #{settings.locale.mkt_amount} (#{settings.symbol})
              tbody
                each r in tx.vout
                  if tx.vout.length > 0 
                    - var ramount = r.amount / 100000000  
                    tr
                      td 
                        a.loading(href='/address/#{r.addresses}') 
                          =r.addresses 
                      td.success.hidden-xs  #{ramount.toFixed(8)}
                    tr.hidden-lg.hidden-md
                      td.success #{ramount.toFixed(8)} #{settings.symbol}
                  else
                    tr
                      td 
                        a.loading(href='/address/#{r.addresses}') 
                          =r.addresses 
                      td.success.hidden-xs  #{ramount.toFixed(8)}
                    tr.hidden-lg.hidden-md
                      td.success #{ramount.toFixed(8)} #{settings.symbol} 
    .footer-padding
